From 5e666acac10bd4e5c479eadb112c450330c644a7 Mon Sep 17 00:00:00 2001
From: Yann Dirson <ydirson@o-computers.com>
Date: Thu, 14 Jan 2016 02:23:12 +0100
Subject: [PATCH 26/27] h3 hdmi: additional mode 800x480p, from lobodis initial
 source import

---
 drivers/video/sunxi/disp2/hdmi/aw/hdmi_bsp_sun8iw7.c | 1 +
 drivers/video/sunxi/disp2/hdmi/aw/hdmi_core.c        | 1 +
 drivers/video/sunxi/disp2/hdmi/drv_hdmi.c            | 1 +
 drivers/video/sunxi/disp2/hdmi/hdmi_hal.h            | 1 +
 drivers/video/sunxi/hdmi/aw/hdmi_edid.c              | 6 ++++++
 include/video/sunxi_display2.h                       | 3 ++-
 6 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/video/sunxi/disp2/hdmi/aw/hdmi_bsp_sun8iw7.c b/drivers/video/sunxi/disp2/hdmi/aw/hdmi_bsp_sun8iw7.c
index de86fe0..d4de730 100755
--- a/drivers/video/sunxi/disp2/hdmi/aw/hdmi_bsp_sun8iw7.c
+++ b/drivers/video/sunxi/disp2/hdmi/aw/hdmi_bsp_sun8iw7.c
@@ -45,6 +45,7 @@ static struct para_tab ptbl[] =
 	{{132		, 2	, 0,  96,	5,	 5, 	5,	1,	 5,     0,	0,	0,	114,	110,	40, 	160, 	30,	1,	1	}},
 	{{257		, 1	, 0,  96,	15,	10, 	8,	2,	 8,	0,	0,	0,	48,	176,	88, 	112,	90,	1,	1	}},
 	{{258		, 1	, 0,  96,	15,	10, 	8,	5,	 8,	4,	0,      0,	160,	32,	88, 	112,	90,	1,	1	}},
+	{{35            , 11    , 0,   0,       1,       3,     3,      0,      13,     0,      0,      208,     228,    80,     60,     208,    45,     0,      0       }},
 };
 
 static unsigned char ca_table[64]=
diff --git a/drivers/video/sunxi/disp2/hdmi/aw/hdmi_core.c b/drivers/video/sunxi/disp2/hdmi/aw/hdmi_core.c
index c313793..3b3313e 100755
--- a/drivers/video/sunxi/disp2/hdmi/aw/hdmi_core.c
+++ b/drivers/video/sunxi/disp2/hdmi/aw/hdmi_core.c
@@ -44,6 +44,7 @@ disp_video_timings video_timing[] =
 	{HDMI720P_60_3D_FP,  0,148500000, 0,  1280,  1440,  1650,  220,  110,  40,  750,   20,  5,  5,  1,   1,   0,   30,  1},
 	{HDMI3840_2160P_30,  0,297000000, 0,  3840,  2160,  4400,  296,  176,  88,  2250,  72,  8, 10,  1,   1,   0,    0,  0},
 	{HDMI3840_2160P_25,  0,297000000, 0,  3840,  2160,  5280,  296, 1056,  88,  2250,  72,  8, 10,  1,   1,   0,    0,  0},
+	{HDMI800_480P,       0,27000000,  0,   800,   480,  1028,   88,   80,  60,   525,  29, 13,  3,  0,   0,   0,    0,  0},
 };
 
 static void hdmi_para_reset(void)
diff --git a/drivers/video/sunxi/disp2/hdmi/drv_hdmi.c b/drivers/video/sunxi/disp2/hdmi/drv_hdmi.c
index dd9ad2c..5f91a6a 100755
--- a/drivers/video/sunxi/disp2/hdmi/drv_hdmi.c
+++ b/drivers/video/sunxi/disp2/hdmi/drv_hdmi.c
@@ -283,6 +283,7 @@ static struct disp_hdmi_mode hdmi_mode_tbl[] = {
 	{DISP_TV_MOD_720P_60HZ_3D_FP,     HDMI720P_60_3D_FP, },
 	{DISP_TV_MOD_3840_2160P_30HZ,     HDMI3840_2160P_30, },
 	{DISP_TV_MOD_3840_2160P_25HZ,     HDMI3840_2160P_25, },
+	{DISP_TV_MOD_800_480P,            HDMI800_480P,      },
 };
 
 __u32 Hdmi_get_vic(u32 mode)
diff --git a/drivers/video/sunxi/disp2/hdmi/hdmi_hal.h b/drivers/video/sunxi/disp2/hdmi/hdmi_hal.h
index bdbebf3..9e47b6c 100755
--- a/drivers/video/sunxi/disp2/hdmi/hdmi_hal.h
+++ b/drivers/video/sunxi/disp2/hdmi/hdmi_hal.h
@@ -16,6 +16,7 @@
 #define HDMI1080P_24 		32
 #define HDMI1080P_25 		33
 #define HDMI1080P_30 		34
+#define HDMI800_480P            35
 #define HDMI1080P_24_3D_FP  (HDMI1080P_24 +0x80)
 #define HDMI720P_50_3D_FP   (HDMI720P_50  +0x80)
 #define HDMI720P_60_3D_FP   (HDMI720P_60  +0x80)
diff --git a/drivers/video/sunxi/hdmi/aw/hdmi_edid.c b/drivers/video/sunxi/hdmi/aw/hdmi_edid.c
index 1cc73b8..e5e0c8c 100755
--- a/drivers/video/sunxi/hdmi/aw/hdmi_edid.c
+++ b/drivers/video/sunxi/hdmi/aw/hdmi_edid.c
@@ -197,6 +197,9 @@ static __s32 Parse_DTD_Block(__u8 *pbuf)
 		if ((sizex== 720) && (sizey == 480)) {
 			//Device_Support_VIC[HDMI480P] = 1;
 		}
+		if ((sizex== 800) && (sizey == 480)) {
+			Device_Support_VIC[HDMI800_480P] = 1;
+		}
 		if ((sizex== 1280) && (sizey == 720)) {
 			Device_Support_VIC[HDMI720P_60] = 1;
 		}
@@ -214,6 +217,9 @@ static __s32 Parse_DTD_Block(__u8 *pbuf)
 		if ((sizex== 720) && (sizey == 576)) {
 			Device_Support_VIC[HDMI576P] = 1;
 		}
+		if ((sizex== 800) && (sizey == 480)) {
+			Device_Support_VIC[HDMI800_480P] = 1;
+		}
 		if ((sizex== 1280) && (sizey == 720)) {
 			Device_Support_VIC[HDMI720P_50] = 1;
 		}
diff --git a/include/video/sunxi_display2.h b/include/video/sunxi_display2.h
index e4764e7..b28e874 100755
--- a/include/video/sunxi_display2.h
+++ b/include/video/sunxi_display2.h
@@ -130,7 +130,8 @@ typedef enum
 	DISP_TV_MOD_3840_2160P_30HZ     = 0x1c,
 	DISP_TV_MOD_3840_2160P_25HZ     = 0x1d,
 	DISP_TV_MOD_3840_2160P_24HZ     = 0x1e,
-	DISP_TV_MODE_NUM                = 0x1f,
+	DISP_TV_MOD_800_480P            = 0x1f,
+	DISP_TV_MODE_NUM                = 0x20,
 }disp_tv_mode;
 
 
-- 
1.9.1

